package com.hiray.taglayoutmanager.uitility;

import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;

/**
 * Created by hiray on 2017/12/18.
 *
 * @author hiray
 */

public class ClickableViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    public ClickableViewHolder(View itemView) {
        super(itemView);
        itemView.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (TextUtils.isEmpty(getText()))
            Toasty.toast("You click item " + getAdapterPosition());
        else Toasty.toast(getText());

    }

    protected String getText() {
        return "";
    }
}
